import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SpecialCareServiceVO, SpecialCareServiceForm, SpecialCareServiceQuery } from '@/api/nursing/specialCareService/types';

/**
 * 查询特殊护理服务列表
 * @param query
 * @returns {*}
 */

export const listSpecialCareService = (query?: SpecialCareServiceQuery): AxiosPromise<SpecialCareServiceVO[]> => {
  return request({
    url: '/nursing/specialCareService/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询特殊护理服务详细
 * @param serviceId
 */
export const getSpecialCareService = (serviceId: string | number): AxiosPromise<SpecialCareServiceVO> => {
  return request({
    url: '/nursing/specialCareService/' + serviceId,
    method: 'get'
  });
};

/**
 * 新增特殊护理服务
 * @param data
 */
export const addSpecialCareService = (data: SpecialCareServiceForm) => {
  return request({
    url: '/nursing/specialCareService',
    method: 'post',
    data: data
  });
};

/**
 * 修改特殊护理服务
 * @param data
 */
export const updateSpecialCareService = (data: SpecialCareServiceForm) => {
  return request({
    url: '/nursing/specialCareService',
    method: 'put',
    data: data
  });
};

/**
 * 删除特殊护理服务
 * @param serviceId
 */
export const delSpecialCareService = (serviceId: string | number | Array<string | number>) => {
  return request({
    url: '/nursing/specialCareService/' + serviceId,
    method: 'delete'
  });
};
